<?php echo $this->Session->flash(); ?>
<h1>ÁREAS DEL PLANO TOPOGRÁFICO PERTENECIENTE AL PREDIO <?php echo $cod; ?></h1>
<div id="loading" style="display: none;">
    <?php echo $html->image('loading.gif', array('border' => "0", 'align' => 'center')); ?>
</div>
<table  id="tabla" class="tabla" >
    <thead>
        <tr>
            <th>Área (ha)</th>
            <th>Tipo de área</th>
            <th colspan="1"></th>
        </tr>
    </thead>
    <tbody>
        <?php foreach ($areas as $area): ?>
            <tr>

                <td><?php echo number_format($area['TopographicArea']['magnitud'], 4, ',', '.') ?></td>
                <td><?php echo $area['AreaType']['nombre'] ?></td>
                <td>
                    <?php if ($this->Session->read('estado') == 0 AND $area['TopographicMap']['cerrado'] == 0) echo $ajax->link('Editar', array('controller' => 'TopographicAreas', 'action' => 'edit', $area['TopographicArea']['id'], $property_id), array('class' => 'actions', 'update' => 'content', 'complete' => 'cargar()', 'indicator' => 'loading', 'escape' => false)); ?>                    
                    <?php if ($this->Session->read('estado') == 0 AND $area['TopographicMap']['cerrado'] == 0) echo $ajax->link('Eliminar', array('controller' => 'TopographicAreas', 'action' => 'delete', $area['TopographicArea']['id'], $property_id, $topographic_map_id), array('class' => 'actions', 'update' => 'content', 'complete' => 'cargar()', 'indicator' => 'loading', 'escape' => false), '¿Realmente desea eliminar el registro?'); ?>                
                </td>
            </tr>
        <?php endforeach; ?>
    </tbody>
</table>
<br>

<table width="100%" border="0"  CellSpacing=10  align="center" >
    <tbody>
        <tr>
            <td>
                <?php if ($this->Session->read('estado') == 0 )echo $ajax->link('Adicionar', array('controller' => 'TopographicAreas', 'action' => 'add', $topographic_map_id, $property_id), array('class' => 'actions', 'update' => 'content', 'complete' => 'cargar()', 'indicator' => 'loading', 'escape' => false)); ?>
            </td>
            <td><?php echo $ajax->link($html->image('regresar.gif', array('width' => '30', 'heigth' => '30', 'alt' => 'Regresar', 'title' => 'regresar')), array('controller' => 'TopographicMaps', 'action' => 'index', $this->Session->read('predio_id')), array('update' => 'content', 'complete' => 'cargar()', 'indicator' => 'loading', 'escape' => false)); ?></td>
        </tr>
    </tbody>
</table>